Skip to content

Add sanitizer support using GCC toolchain features#64

Open
RSingh1511 wants to merge 4 commits intoeclipse-score:mainfrom
RSingh1511:rs/swp-245137
Open

Add sanitizer support using GCC toolchain features#64
RSingh1511 wants to merge 4 commits intoeclipse-score:mainfrom
RSingh1511:rs/swp-245137

Conversation

@RSingh1511
Copy link
Contributor

Notes for Reviewer

Pre-Review Checklist for the PR Author

  • PR title is short, expressive and meaningful
  • Commits are properly organized
  • Relevant issues are linked in the References section
  • Tests are conducted
  • Unit tests are added

Checklist for the PR Reviewer

  • Commits are properly organized and messages are according to the guideline
  • Unit tests have been written for new behavior
  • Public API is documented
  • PR title describes the changes

Post-review Checklist for the PR Author

  • All open points are addressed and tracked via issues

References

Closes #

@github-actions
Copy link

github-actions bot commented Feb 16, 2026

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run //:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
2026/02/25 11:37:35 Downloading https://releases.bazel.build/8.3.0/release/bazel-8.3.0-linux-x86_64...
Extracting Bazel installation...
Starting local Bazel server (8.3.0) and connecting to it...
INFO: Invocation ID: de883a33-efe2-4444-8866-1fab76b8b393
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
WARNING: For repository 'rules_python', the root module requires module version rules_python@1.4.1, but got rules_python@1.8.3 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'bazel_skylib', the root module requires module version bazel_skylib@1.7.1, but got bazel_skylib@1.8.2 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'rules_rust', the root module requires module version rules_rust@0.61.0, but got rules_rust@0.67.0 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'rules_cc', the root module requires module version rules_cc@0.1.1, but got rules_cc@0.2.16 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'aspect_rules_lint', the root module requires module version aspect_rules_lint@1.0.3, but got aspect_rules_lint@2.0.0 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'buildifier_prebuilt', the root module requires module version buildifier_prebuilt@7.3.1, but got buildifier_prebuilt@8.2.0.2 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'score_rust_policies', the root module requires module version score_rust_policies@0.0.3, but got score_rust_policies@0.0.5 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'googletest', the root module requires module version googletest@1.17.0.bcr.1, but got googletest@1.17.0.bcr.2 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
Computing main repo mapping: 
Computing main repo mapping: 
Loading: 
Loading: 4 packages loaded
Loading: 4 packages loaded
    currently loading: 
WARNING: Target pattern parsing failed.
ERROR: Skipping '//:license-check': no such target '//:license-check': target 'license-check' not declared in package '' defined by /home/runner/work/logging/logging/BUILD
ERROR: no such target '//:license-check': target 'license-check' not declared in package '' defined by /home/runner/work/logging/logging/BUILD
INFO: Elapsed time: 10.048s
INFO: 0 processes.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target

@github-actions
Copy link

The created documentation from the pull request is available at: docu-html

@RSingh1511 RSingh1511 marked this pull request as ready for review February 16, 2026 10:03
FScholPer
FScholPer previously approved these changes Feb 16, 2026
MODULE.bazel Outdated
bazel_dep(name = "score_bazel_platforms", version = "0.0.4")
bazel_dep(name = "score_docs_as_code", version = "2.2.0")
bazel_dep(name = "score_tooling", version = "1.1.1")
bazel_dep(name = "score_docs_as_code", version = "2.3.0")
Copy link

@MaximilianSoerenPollak MaximilianSoerenPollak Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You will need docs-as-code 3.0.1 if you want to use tooling 1.1.2.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've verified that score_docs_as_code@2.3.0 works correctly with score_tooling@1.1.2 and all tests pass. The sanitizer implementation is complete and ready for review.

Using 3.0.1 causes CI failures because score_tooling@1.1.2 declares it as dev_dependency = True, making it invisible to consuming modules.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need the new added Documentation API this from tooling 1.1.2?
If not then downgrading to 1.1.0 and upgrading docs-as-code to 3.0.0 would be advisable.
Otherwise you will not be able to use the new features from docs-as-code.
See Features Here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! Downgraded to score_tooling@1.1.0.

Keeping score_docs_as_code@2.3.0 due to compatibility with score_baselibs (all released versions require 2.3.0). Upgrading to 3.0.0 causes CI failures.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong rebase on main

FScholPer
FScholPer previously approved these changes Feb 17, 2026
Copy link
Contributor

@pawelrutkaq pawelrutkaq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry we need to postone it until logging in in shape and works with other repos. Then I will review and recheck.

@@ -0,0 +1,63 @@
# *******************************************************************************
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this is seperate workflow ? isnt it something that shall run in coverage and user shall jsut have ability to enable it ? At the end, its running tests

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a good idea to combine coverage instrumentation with sanitizer instrumentation as they can affect each other in gcc: we may get incorrect coverage data, and maybe even get false positives in sanitizers.

MODULE.bazel Outdated
bazel_dep(name = "score_bazel_platforms", version = "0.0.4")
bazel_dep(name = "score_docs_as_code", version = "2.2.0")
bazel_dep(name = "score_tooling", version = "1.1.1")
bazel_dep(name = "score_docs_as_code", version = "2.3.0")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong rebase on main

coverage --cxxopt -runtime-counter-relocation

# Dynamic analysis (sanitizers) for Linux host builds/tests.
try-import %workspace%/quality/sanitizer/sanitizer.bazelrc
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would keep it into bazelrc for now.

set -euo pipefail
echo "Running: bazel test --config=${{ matrix.sanitizer_config }} //tests/cpp/..."
# Note: Only testing C++ targets as Rust sanitizers require different configuration
bazel test --config=${{ matrix.sanitizer_config }} //tests/cpp/...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not correct target ? we shall remove contant od tests as they ment to be for cit/fit. Run correct target and let see how long it takes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Rust targets fail with C++ sanitizer flags due to linking
incompatibilities
Comment on lines +21 to +22
test:asan_ubsan_lsan --test_env=ASAN_OPTIONS=exitcode=55:allow_addr2line=1:verbosity=1:detect_leaks=1:halt_on_error=1:allocator_may_return_null=1
test:asan_ubsan_lsan --test_env=UBSAN_OPTIONS=exitcode=55:allow_addr2line=1:verbosity=1:print_stacktrace=1:halt_on_error=1
Copy link

@stmuench stmuench Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

such env settings for sanitizers should instead come from a common place to prevent that every sub-repo configures them differently

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stmuench Good point! This aligns with @4og suggestion for a
centralized C++ policies repo (similar to https://github.com/eclipse-score/score_rust_policies)

test:tsan --compilation_mode=dbg
test:tsan --features=tsan
test:tsan --platform_suffix=tsan
test:tsan --test_env=TSAN_OPTIONS=exitcode=55:allow_addr2line=1:verbosity=1:halt_on_error=1:detect_deadlocks=1

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants